using System.Collections.Generic;
using NetMigration.Domains;
using NUnit.Framework;

namespace NetMigrationTests.FunctionalTests
{
    internal static class TableTestHelper
    {
        private static readonly DataFactory dataFactory = new DataFactory();

        public static void Should(this Table table, bool condition)
        {
            List<string> tableNames = dataFactory.GetTableNames();
            Assert.AreEqual(condition, tableNames.Contains(table.Name));
        }

        public static void TestDrop(this Table table)
        {
            dataFactory.Drop(table.Name);
        }

        public static void ShouldContainsColumn(this Table table, string columnName)
        {
            List<string> columns = dataFactory.GetColumns(table.Name);
            Assert.Contains(columnName, columns);
        }
    }
}